package com.newtouch.bxzs.policy.controller;

import com.newtouch.bxzs.common.base.response.BaseResponse;
import com.newtouch.bxzs.common.base.response.RespGenerator;
import com.newtouch.bxzs.policy.model.bo.PreservationBO;
import com.newtouch.bxzs.policy.model.bo.family.*;
import com.newtouch.bxzs.policy.model.vo.*;
import com.newtouch.bxzs.policy.model.vo.family.*;
import com.newtouch.bxzs.policy.service.FamilyPolicyInsuranceService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;

/**
 * 家庭单管理保险controller层
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021/1/7 10:12</td>
 * <td>linhongxi</td>
 * <td>Create</td>
 * </tr>
 * </table>
 *
 * @author linhongxi
 * @version 1.0.0
 * @since 1.0.0
 */
@ApiIgnore
@RestController
@SuppressWarnings("unchecked")
@RequestMapping("/familyPolicyInsurance")
public class FamilyPolicyInsuranceController {
    /** 静态变量：系统日志 */
    private static final Log logger = LogFactory.getLog(FamilyPolicyInsuranceController.class);

    @Resource
    private FamilyPolicyInsuranceService familyPolicyInsuranceService;

    @PostMapping("/getFamilyPolicyInfoInsurance")
    public BaseResponse<FamilyPolicyBO> familyPolicyInfoInsurance(@RequestBody PolicyInfoVO policyInfoVO) {
        logger.info("查询家庭单保单详情");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getFamilyPolicyInfoInsurance(policyInfoVO));
    }

    @PostMapping(value = "/getFamilyPolicyPreservationInsurance")
    public BaseResponse<PreservationBO> familyPolicyPreservationInsurance(@RequestBody PolicyInfoPageVO policyInfoPageVO) {
        logger.info("调用查询家庭单保全信息外部接口");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getFamilyPolicyPreservationInsurance(policyInfoPageVO));
    }

    @PostMapping(value = "/getFamilyPolicyClaimsInsurance")
    public BaseResponse<FamilyClaimsBO> familyPolicyClaimsInsurance(@RequestBody PolicyInfoPageVO policyInfoPageVO) {
        logger.info("调用查询家庭单理赔信息外部接口");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getPolicyClaimsInsurance(policyInfoPageVO));
    }

    @PostMapping(value = "/getFamilyPolicyUserListInsurance")
    public BaseResponse<PolicyUserListBO> familyPolicyUserListInsurance(@RequestBody PolicyUserListVO policyUserListVO) {
        logger.info("查询家庭单人员清单接口");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getFamilyPolicyUserListInsurance(policyUserListVO));
    }

    @PostMapping(value = "/getPreservationListByFamilyPolicyInsurance")
    public BaseResponse<FamilyPreservationProgressInfoBO> preservationListByFamilyPolicyInsurance(@RequestBody FamilyPreservationVO familyPreservationVO) {
        logger.info("查询家庭单保全进度列表");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getPreservationListByFamilyPolicyInsurance(familyPreservationVO));
    }

    @PostMapping(value = "/getPreservationInfoByFamilyPolicyInsurance")
    public BaseResponse<FamilyPreservationProgressInfoBO> preservationInfoByFamilyPolicyInsurance(@RequestBody PreservationProgressInfoVO PreservationProgressInfoVO) {
        logger.info("查看家庭单保全进度详情");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getPreservationInfoByFamilyPolicyInsurance(PreservationProgressInfoVO));
    }

    @PostMapping(value = "/getClaimsProgressListByFamilyPolicyInsurance")
    public BaseResponse<FamilyClaimsBO> claimsProgressListByFamilyPolicyInsurance(@RequestBody FamilyClaimsVO familyClaimsVO) {
        logger.info("查询家庭单理赔进度列表");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getClaimsProgressListByFamilyPolicyInsurance(familyClaimsVO));
    }

    @PostMapping(value = "/getNewContractInfoByFamilyPolicyInsurance")
    public BaseResponse<FamilyPolicyNewContractBO> newContractInfoByFamilyPolicyInsurance(@RequestBody PolicyNewContractInfoVO policyNewContractInfoVO) {
        logger.info("查看家庭单新契约详情");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getNewContractInfoByFamilyPolicyInsurance(policyNewContractInfoVO));
    }

    @PostMapping(value = "/getNewContractListByFamilyPolicyInsurance")
    public BaseResponse<FamilyPolicyNewContractBO> newContractListByFamilyPolicyInsurance(@RequestBody FamilyPolicyNewContractVO familyPolicyNewContractVO) {
        logger.info("查询家庭单新契约列表");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getNewContractListByFamilyPolicyInsurance(familyPolicyNewContractVO));
    }

    @PostMapping(value = "/getNewContractUserListByFamilyPolicyInsurance")
    public BaseResponse<PolicyUserListBO> newContractUserListByFamilyPolicyInsurance(@RequestBody FamilyPolicyNewContractInfoVO familyPolicyNewContractInfoVO) {
        logger.info("查询家庭单人员清单接口");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getNewContractUserListByFamilyPolicyInsurance(familyPolicyNewContractInfoVO));
    }

    @PostMapping(value = "/getExpirationPolicyListByFamilyPolicyInsurance")
    public BaseResponse<FamilyExpirationPolicyBO> expirationPolicyListByFamilyPolicyInsurance(@RequestBody FamilyExpirationPolicyVO familyExpirationPolicyVO) {
        logger.info("查询家庭单满期信息列表");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getExpirationPolicyListByFamilyPolicyInsurance(familyExpirationPolicyVO));
    }

    @PostMapping(value = "/getRenewalPolicyListByFamilyPolicyInsurance")
    public BaseResponse<FamilyRenewalPolicyBO> renewalPolicyListByFamilyPolicyInsurance(@RequestBody FamilyRenewalPolicyVO familyRenewalPolicyVO) {
        logger.info("查询家庭单续期信息列表");
        return RespGenerator.returnOK(familyPolicyInsuranceService.getRenewalPolicyListByFamilyPolicyInsurance(familyRenewalPolicyVO));
    }
}
